function columns(vm) {
  const cols = [
    {
      title: '序号',
      key: 'rowIndex',
      width: 60,
      align: 'center',
      customRender: function (text, row, index) {
        if (row.totalName == '合计') {
          return {
            children: vm.transformVnode('合计'),
            attrs: {
              colSpan: 3,
            },
          }
        } else if (row.serialnumber) {
          return 1
        } else {
          return (vm.ipagination.current - 1) * 10 + Number(index - 1)
        }
      }
    },
    {
      title: '总包部/指挥部名称',
      key: 'name',
      dataIndex: 'name',
      align: 'center',
      scopedSlots: { customRender: 'name' },
      customRender: function (text, row, index) {
        if (row.totalName == '合计') {
          return {
            attrs: {
              colSpan: 0,
            },
          }
        } else {
          return {
            children: vm.TransformVnodeEllipsis(text, row, 'name')
          }
        }
      }
    },
    {
      title: '项目名称',
      key: 'xmmc',
      dataIndex: 'xmmc',
      align: 'center',
      scopedSlots: { customRender: 'xmmc' },
      customRender: function (text, row, index) {
        if (row.totalName == '合计') {
          return {
            attrs: {
              colSpan: 0,
            },
          }
        } else {
          return {
            children: vm.TransformVnodeEllipsis(text, row, 'xmmc')
          }
        }
      }
    },
    {
      title: '项目类型',
      key: 'xmlx',
      dataIndex: 'xmlx',
      align: 'center',
      scopedSlots: { customRender: 'xmlx' },
    },
    {
      title: '投资/承包项目',
      key: 'tzcblx',
      dataIndex: 'tzcblx',
      align: 'center',
      scopedSlots: { customRender: 'tzcblx' },
    },
    {
      title: '	项目所在地（省、市）',
      key: 'xmszd',
      dataIndex: 'xmszd',
      align: 'center',
      scopedSlots: { customRender: 'xmszd' },
    },
    {
      title: '业主情况',
      align: 'center',
      children: [
        {
          title: '业主类别',
          align: 'center',
          dataIndex: 'xzlb',
          key: 'xzlb',
          scopedSlots: { customRender: 'xzlb' },
        },
        {
          title: '业主名称',
          align: 'center',
          dataIndex: 'xzmc',
          key: 'xzmc',
          scopedSlots: { customRender: 'xzmc' },
        },
      ]
    },
    {
      title: '项目状态（久竣未结/已竣未结/已竣已结）',
      key: 'xmzt',
      dataIndex: 'xmzt',
      align: 'center',
      scopedSlots: { customRender: 'xmzt' },
    },
    {
      title: '工期',
      align: 'center',
      children: [
        {
          title: '合同开工工期',
          align: 'center',
          dataIndex: 'htkgText',
          key: 'htkgText',
          scopedSlots: { customRender: 'htkgText' },
        },
        {
          title: '合同完工日期',
          align: 'center',
          dataIndex: 'htwgText',
          key: 'htwgText',
          scopedSlots: { customRender: 'htwgText' },
        },
        {
          title: '实际开工日期',
          align: 'center',
          dataIndex: 'sjkgText',
          key: 'sjkgText',
          scopedSlots: { customRender: 'sjkgText' },
        },
        {
          title: '交工验收日期',
          align: 'center',
          dataIndex: 'sjjgysText',
          key: 'sjjgysText',
          scopedSlots: { customRender: 'sjjgysText' },
        },
        {
          title: '停工日期',
          align: 'center',
          dataIndex: 'tgrqText',
          key: 'tgrqText',
          scopedSlots: { customRender: 'tgrqText' },
        },
        {
          title: '最近一期验工计价日期',
          align: 'center',
          dataIndex: 'ygjjText',
          key: 'ygjjText',
          scopedSlots: { customRender: 'ygjjText' },
        },
      ]
    },

    {
      title: '是否已经完成竣工结算',
      key: 'sfjgjs',
      dataIndex: 'sfjgjs',
      align: 'center',
      scopedSlots: { customRender: 'sfjgjs' },
    },

    {
      title: 'EPC合同总额',
      align: 'center',
      children: [
        {
          title: '初始合同额',
          align: 'center',
          dataIndex: 'csht',
          key: 'csht',
          scopedSlots: { customRender: 'csht' },
        },
        {
          title: '补充合同额',
          align: 'center',
          dataIndex: 'bcht',
          key: 'bcht',
          scopedSlots: { customRender: 'bcht' },
        },
      ]
    },

    {
      align: 'center',
      slots: { title: 'endTimeTitleA' },
      children: [
        {
          title: '设计院开累账面利润（计提的上级管理费还原为利润）',
          align: 'right',
          dataIndex: 'klzmlr',
          key: 'klzmlr',
          scopedSlots: { customRender: 'klzmlr' },

        },
        {
          title: '设计院实际利润',
          align: 'center',
          children: [
            {
              title: '设计开累验工计价（不含税）',
              align: 'right',
              dataIndex: 'klygjj',
              key: 'klygjj',
              scopedSlots: { customRender: 'klygjj' },

            },
            {
              title: '待批复验工计价',
              align: 'right',
              dataIndex: 'dpfygjj',
              key: 'dpfygjj',
              scopedSlots: { customRender: 'dpfygjj' },

            },
            {
              title: '合同履约成本-工程施工（不含分包成本）',
              align: 'right',
              dataIndex: 'htlycb',
              key: 'htlycb',
              scopedSlots: { customRender: 'htlycb' },

            },
            {
              title: '已发生未列账成本（不含分包成本）',
              align: 'right',
              dataIndex: 'yfswlcb',
              key: 'yfswlcb',
              scopedSlots: { customRender: 'yfswlcb' },

            },
            {
              title: '虚列超列成本（不含分包成本）',
              align: 'right',
              dataIndex: 'xlclcb',
              key: 'xlclcb',
              scopedSlots: { customRender: 'xlclcb' },

            },
            {
              title: '上级管理费（包括二三级公司收取管理费）',
              align: 'right',
              dataIndex: 'sjglf',
              key: 'sjglf',
              scopedSlots: { customRender: 'sjglf' },

            },
            {
              title: '开累利润',
              align: 'right',
              dataIndex: 'kllr',
              key: 'kllr',
              scopedSlots: { customRender: 'kllr' },

            },
          ]
        },
      ]
    },

    {
      slots: { title: 'endTimeTitleB' },
      align: 'right',
      children: [
        {
          title: '已计价',
          align: 'right',
          dataIndex: 'yjj',
          key: 'yjj',
          scopedSlots: { customRender: 'yjj' },
        },
        {
          title: '待批复变更索赔',
          align: 'right',
          dataIndex: 'dpfbgsp',
          key: 'dpfbgsp',
          scopedSlots: { customRender: 'dpfbgsp' },
        },
      ]
    },

    {
      align: 'center',
      slots: { title: 'endTimeTitleC' },
      children: [
        {
          title: '分包单位合同额',
          align: 'right',
          dataIndex: 'fbdwhte',
          key: 'fbdwhte',
          scopedSlots: { customRender: 'fbdwhte' },
        },
        {
          title: '已计价（含变更调差等）',
          align: 'right',
          dataIndex: 'yjjBgtc',
          key: 'yjjBgtc',
          scopedSlots: { customRender: 'yjjBgtc' },
        },
        {
          title: '已完未计（含变更调差等）',
          align: 'right',
          dataIndex: 'ywjjBgtc',
          key: 'ywjjBgtc',
          scopedSlots: { customRender: 'ywjjBgtc' },
        },
        {
          title: '各分包单位简称',
          align: 'right',
          dataIndex: 'gfbdwjc',
          key: 'gfbdwjc',
          scopedSlots: { customRender: 'gfbdwjc' },
        },
      ]
    },

    {
      align: 'center',
      slots: { title: 'endTimeTitleD' },
      children: [
        {
          title: '应收工程款（不含质保金）',
          align: 'right',
          dataIndex: 'ysgck',
          key: 'ysgck',
          scopedSlots: { customRender: 'ysgck' },
        },
        {
          title: '应收质保金',
          align: 'right',
          dataIndex: 'yszbj',
          key: 'yszbj',
          scopedSlots: { customRender: 'yszbj' },
        },
        {
          title: '实际收到工程款',
          align: 'right',
          dataIndex: 'sjsdgck',
          key: 'sjsdgck',
          scopedSlots: { customRender: 'sjsdgck' },
        },
        {
          title: '支付分包单位工程款',
          align: 'right',
          dataIndex: 'zffbdw',
          key: 'zffbdw',
          scopedSlots: { customRender: 'zffbdw' },
        },
        {
          title: '应付工程款',
          align: 'right',
          dataIndex: 'yfgck',
          key: 'yfgck',
          scopedSlots: { customRender: 'yfgck' },
        },
      ]
    },
    {
      title: '未完成竣工结算原因、工作目标、下一步措施简述（另附书面说明）',
      key: 'reason',
      dataIndex: 'reason',
      align: 'center',
      scopedSlots: { customRender: 'reason' },
    },
    {
      title: '备注',
      key: 'remark',
      dataIndex: 'remark',
      align: 'center',
      scopedSlots: { customRender: 'remark' },
    },
    {
      dataIndex: 'submitFlag',
      align: 'center',
      title: "状态",
      scopedSlots: { customRender: 'submitFlag' },
      key: 'submitFlag',
      fixed: 'right',
      width: 80,
    },
    {
      dataIndex: 'action',
      align: 'center',
      title: "操作",
      scopedSlots: { customRender: 'action' },
      key: 'action',
      width: 100,
      fixed: 'right',
    }
  ]
  return cols
}

export default columns